package com.weayer.controller;


import com.weayer.dto.DriverCarBindingRelationship;
import com.weayer.dto.ResponseResult;
import com.weayer.service.DriverCarBindingRelationshipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * @description: Service服务 - 司机 - 司机车辆绑定管理controller
 * @author: Weayer
 **/
@RestController
@RequestMapping("/driver-car-binding-relationship")
public class DriverCarBindingRelationshipController {
    @Autowired
    private DriverCarBindingRelationshipService driverCarBindingRelationshipService;

    @PostMapping("/bind")
    public ResponseResult bind(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship){
        return driverCarBindingRelationshipService.bind(driverCarBindingRelationship);
    }
    @PostMapping("/unbind")
    public ResponseResult unbind(@RequestBody DriverCarBindingRelationship driverCarBindingRelationship){
        return driverCarBindingRelationshipService.unbind(driverCarBindingRelationship);
    }
    @GetMapping("/get")
    public ResponseResult get(@RequestParam String driverPhone){
        return driverCarBindingRelationshipService.getDriverCarRelationShip(driverPhone);
    }
}
